<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>ECharts</title>
    <script src="../../js/echarts.js"></script>
    <!-- 引入刚刚下载的 ECharts 文件 -->

</head>
<body>
<!-- 为 ECharts 准备一个定义了宽高的 DOM -->
<div id="main" style="width: 600px;height:400px;"></div>
<!-- 开发环境版本，包含了有帮助的命令行警告 -->
<script src="../../plugins/vue/vue.js"></script>
<!-- 引入组件库 -->
<script src="../../plugins/element-ui/index.js"></script>
<!-- 引入axios -->
<script src="../../plugins/axios/axios.min.js"></script>
<script src="../../js/request.js"></script>
<script src="../../api/view.js"></script>
<script type="text/javascript">
    new Vue({
        data() {
            return {
                dataone: [],
            }
        },
        created() {
            this.initData()
        },
        mounted() {

        },
        methods: {
            async initData() {
                getOrderDetailTable({}).then(res => {
                    if (String(res.code) === '1') {
                        // this.dataone = res.data
                        // console.log(this.dataone)
                        let yy = []
                        for (let key in res.data) {
                            yy.push(res.data[key])
                        }
                        // console.log("财务室is部分IU是BF爱",yy)
                        // 基于准备好的dom，初始化echarts实例
                        var myChart = echarts.init(document.getElementById('main'));

                        // 指定图表的配置项和数据
                        var option = {
                            title: {
                                text: '表单数据'
                            },
                            tooltip: {},
                            legend: {
                                data: ['数据']
                            },
                            xAxis: {
                                data: ['订单数量']
                            },
                            yAxis: {},
                            series: [
                                {
                                    name: '数据',
                                    type: 'bar',
                                    data: yy
                                }
                            ]
                        };
                        myChart.setOption(option);
                    }
                }).catch(err => {
                    this.$message.error('请求出错了：' + err)
                })
            }
        }
    })

</script>
</body>
</html>